package ui;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Frame;
import java.awt.Panel;

import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;

import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class TVFFrame {
	
	private static final FormToolkit formToolkit = new FormToolkit(
			Display.getDefault());

	public static void mostrarArbol(Composite p, String filePath) {
		Composite comp = new Composite(p, SWT.EMBEDDED);
		Frame frame = SWT_AWT.new_Frame(comp);
		JPanel tree = (JPanel) new JTreeView().getPanel(filePath);
		frame.add(tree);
		
		comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
		formToolkit.adapt(comp);
		formToolkit.paintBordersFor(comp);
		//frame.setSize(parent.getSize().x,parent.getSize().y);
		
	}
	
	public static void mostrarArbol(String filePath) {
		//Composite comp = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
		Frame frame = new Frame("Prueba");
		JPanel tree = new JTreeView().getPanel(filePath);
		frame.add(tree);
		frame.setTitle(filePath);
		frame.setVisible(true);
		frame.setSize(800, 600);
		
	}

}
